package com.deli.service.impl;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.deli.entity.Answer;
import com.deli.entity.Answer7;
import com.deli.entity.CharacterAnalysis;
import com.deli.entity.TestResult;
import com.deli.mapper.TestResultMapper;
import com.deli.service.*;
import com.deli.utils.GetUserInfoUtil;
import com.deli.utils.HttpUtil;
import com.deli.utils.XmlUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;

@Service("testResultService")
@Transactional
public class TestResultServiceImpl implements TestResultService {

    @Autowired
    private TestResultMapper testResultMapper;
    @Autowired
    private TestUserListService testUserListService;
    @Autowired
    private TestQuestion180Service testQuestion180Service;
    @Autowired
    private TestQuestion93Service testQuestion93Service;
    @Autowired
    private TestQuestion7Service testQuestion7Service;
    @Autowired
    private TestAnalysis93Service testAnalysis93Service;
    @Autowired
    private TestAnalysis7Service testAnalysis7Service;

    /**
     * 提交答案
     *
     * @param userName 名字（花名或者本名）
     * @param phoneNum 电话号码
     * @param answer   页面传过来的答案的json字符串
     * @return
     * @throws Exception
     */
    @Override
    public Integer resultSubmit(String userName, String phoneNum, String answer, Integer testType, Long breakTime) throws Exception {
        //1.首先在名单里查询是否有这个人，如果有这个人
        List<LinkedHashMap<String, Object>> status = testUserListService.getStatusAndTestTypeByNameAndPhoneAndTestType(userName, phoneNum, testType);
        //有测评资格者，获取测评的类型和测评状态
        //如果测评的状态是-1代表已经答题结束，0为未答题，1为正在答题
        int testStatus = Integer.parseInt(status.get(0).get("status").toString());
        if (testStatus == -1) {
            //已经完成答题了
            throw new Exception("您已经完成测评，无需重复提交测评");
        }

        //答案的list
        ArrayList<String> answerList = JSONArray.parseObject(answer, ArrayList.class);
        if (testStatus == 0) {
            //用id获取人名
            //getResultByAnswerList
            String result = "";
            if (testType == 180) {
                if (answerList.size() != 180) {
                    //没有答题结束
                    TestResult testResult = this.getUserInfoByUserNameAndPhoneNum(status.get(0).get("userName").toString(), status.get(0).get("mobilePhone").toString());
                    testResult.setTestType(testType);//测评类型
                    if (status.get(0).get("userPosition") == null) {
                        testResult.setUserPosition(null);
                    } else {
                        testResult.setUserPosition(status.get(0).get("userPosition").toString());//岗位
                    }

                    if (status.get(0).get("departmentname") == null) {
                        testResult.setTextfield(null);
                    } else {
                        testResult.setDepartmentname(status.get(0).get("departmentname").toString());//部门
                    }

                    if (status.get(0).get("textfield") == null) {
                        testResult.setTextfield(null);
                    } else {
                        testResult.setTextfield(status.get(0).get("textfield").toString());//花名
                    }

                    testResult.setAnswer(JSON.toJSONString(answerList));
                    testResult.setBreakTime(breakTime);//中断时间
                    //1、添加结果表记录
                    testResultMapper.addRecordNoResult(testResult);
                    //2、更改名单表的状态
                    Integer update = testUserListService.updateStatusByUserNameAndPhoneNum(userName, phoneNum, testType, 1);
                    return update;
                } else {
                    //如果是一次答题结束
                    result = this.getResultByAnswerList180(answerList);
                    TestResult testResult = this.getUserInfoByUserNameAndPhoneNum(status.get(0).get("userName").toString(), status.get(0).get("mobilePhone").toString());
                    testResult.setTestType(testType);//测评类型
                    testResult.setUserPosition(status.get(0).get("userPosition").toString());//岗位
                    testResult.setDepartmentname(status.get(0).get("departmentname").toString());//部门
                    testResult.setTextfield(status.get(0).get("textfield").toString());//花名
                    testResult.setBreakTime(breakTime);//中断时间
                    testResult.setResult(result);//结果
                    testResult.setAnswer(JSON.toJSONString(answerList));//答案
                    //1、添加结果表记录
                    testResultMapper.addRecordWithResult(testResult);
                    //2、更改名单表的状态
                    Integer update = testUserListService.updateStatusByUserNameAndPhoneNum(userName, phoneNum, testType, -1);
                    return update;
                }
            } else if (testType == 93) {
                if (answerList.size() != 93) {
                    //没有答题结束
                    TestResult testResult = this.getUserInfoByUserNameAndPhoneNum(status.get(0).get("userName").toString(), status.get(0).get("mobilePhone").toString());
                    testResult.setTestType(testType);//测评类型
                    if (status.get(0).get("userPosition") == null) {
                        testResult.setUserPosition(null);
                    } else {
                        testResult.setUserPosition(status.get(0).get("userPosition").toString());//岗位
                    }

                    if (status.get(0).get("departmentname") == null) {
                        testResult.setTextfield(null);
                    } else {
                        testResult.setDepartmentname(status.get(0).get("departmentname").toString());//部门
                    }

                    if (status.get(0).get("textfield") == null) {
                        testResult.setTextfield(null);
                    } else {
                        testResult.setTextfield(status.get(0).get("textfield").toString());//花名
                    }

                    testResult.setAnswer(JSON.toJSONString(answerList));
                    testResult.setBreakTime(breakTime);//中断时间
                    //1、添加结果表记录
                    testResultMapper.addRecordNoResult(testResult);
                    //2、更改名单表的状态
                    Integer update = testUserListService.updateStatusByUserNameAndPhoneNum(userName, phoneNum, testType, 1);
                    return update;
                } else {
                    //如果是一次答题结束
                    result = this.getResultByAnswerList93(answerList);
                    TestResult testResult = this.getUserInfoByUserNameAndPhoneNum(status.get(0).get("userName").toString(), status.get(0).get("mobilePhone").toString());
                    testResult.setTestType(testType);//测评类型
                    testResult.setUserPosition(status.get(0).get("userPosition").toString());//岗位
                    testResult.setDepartmentname(status.get(0).get("departmentname").toString());//部门
                    testResult.setTextfield(status.get(0).get("textfield").toString());//花名
                    testResult.setBreakTime(breakTime);//中断时间
                    testResult.setResult(result);//结果
                    testResult.setAnswer(JSON.toJSONString(answerList));//答案
                    //1、添加结果表记录
                    testResultMapper.addRecordWithResult(testResult);
                    //2、更改名单表的状态
                    Integer update = testUserListService.updateStatusByUserNameAndPhoneNum(userName, phoneNum, testType, -1);
                    return update;
                }
            } else if (testType == 7) {
                if (answerList.size() != 7) {
                    //没有答题结束
                    TestResult testResult = this.getUserInfoByUserNameAndPhoneNum(status.get(0).get("userName").toString(), status.get(0).get("mobilePhone").toString());
                    testResult.setTestType(testType);//测评类型
                    if (status.get(0).get("userPosition") == null) {
                        testResult.setUserPosition(null);
                    } else {
                        testResult.setUserPosition(status.get(0).get("userPosition").toString());//岗位
                    }

                    if (status.get(0).get("departmentname") == null) {
                        testResult.setTextfield(null);
                    } else {
                        testResult.setDepartmentname(status.get(0).get("departmentname").toString());//部门
                    }

                    if (status.get(0).get("textfield") == null) {
                        testResult.setTextfield(null);
                    } else {
                        testResult.setTextfield(status.get(0).get("textfield").toString());//花名
                    }

                    testResult.setAnswer(JSON.toJSONString(answerList));
                    testResult.setBreakTime(breakTime);//中断时间
                    //1、添加结果表记录
                    testResultMapper.addRecordNoResult(testResult);
                    //2、更改名单表的状态
                    Integer update = testUserListService.updateStatusByUserNameAndPhoneNum(userName, phoneNum, testType, 1);
                    return update;
                } else {
                    //如果是一次答题结束
                    result = this.getResultByAnswerList7(answerList);
                    TestResult testResult = this.getUserInfoByUserNameAndPhoneNum(status.get(0).get("userName").toString(), status.get(0).get("mobilePhone").toString());
                    testResult.setTestType(testType);//测评类型
                    testResult.setUserPosition(status.get(0).get("userPosition").toString());//岗位
                    testResult.setDepartmentname(status.get(0).get("departmentname").toString());//部门
                    if (status.get(0).get("textfield") != null) {
                        testResult.setTextfield(status.get(0).get("textfield").toString());//花名
                    }
                    testResult.setBreakTime(breakTime);//中断时间
                    testResult.setResult(result);//结果
                    testResult.setAnswer(JSON.toJSONString(answerList));//答案
                    //1、添加结果表记录
                    testResultMapper.addRecordWithResult(testResult);
                    //2、更改名单表的状态
                    Integer update = testUserListService.updateStatusByUserNameAndPhoneNum(userName, phoneNum, testType, -1);
                    return update;
                }
            }
        }

        //状态为1,进行中
        //2.用名字和电话查询结果表
        List<LinkedHashMap<String, Object>> answerByUserNameAndPhoneNum = testResultMapper.getAnswerByUserNameAndPhoneNum(userName, phoneNum, testType);

        //获取答案，拼接字符串
        String ExistAnswer = answerByUserNameAndPhoneNum.get(0).get("answer").toString();
        List<String> ExistAnswerList = JSON.parseArray(ExistAnswer, String.class);
        //把传过来的拼接到现有的答案里去
        for (String answerString : answerList) {
            ExistAnswerList.add(answerString);
        }
        String result = "";
        if (testType == 180) {
            //如果添加完的数量不是180，那么更新中断时间
            if (ExistAnswerList.size() != 180) {
                //更新答案和中断时间
                Integer update = testResultMapper.updateAnswerByUserNameAndPhoneNum(userName, phoneNum,
                        JSON.toJSONString(ExistAnswerList), breakTime, testType);
                return update;
            }
            //添加完之后是180题，计算结果更新，中断时间变为0
            result = this.getResultByAnswerList180((ArrayList<String>) ExistAnswerList);
        } else if (testType == 93) {
            //如果添加完的数量不是93，那么更新中断时间
            if (ExistAnswerList.size() != 93) {
                //更新答案和中断时间
                Integer update = testResultMapper.updateAnswerByUserNameAndPhoneNum(userName, phoneNum,
                        JSON.toJSONString(ExistAnswerList), breakTime, testType);
                return update;
            }
            //添加完之后是180题，计算结果更新，中断时间变为0
            result = this.getResultByAnswerList93((ArrayList<String>) ExistAnswerList);
        } else if (testType == 7) {
            //如果添加完的数量不是93，那么更新中断时间
            if (ExistAnswerList.size() != 7) {
                //更新答案和中断时间
                Integer update = testResultMapper.updateAnswerByUserNameAndPhoneNum(userName, phoneNum,
                        JSON.toJSONString(ExistAnswerList), breakTime, testType);
                return update;
            }
            //添加完之后是180题，计算结果更新，中断时间变为0
            result = this.getResultByAnswerList7((ArrayList<String>) ExistAnswerList);
        }
        //1.0更新结果表
        Integer update = testResultMapper.updateAnswerAndResultAndBreakTimeByUserNameAndPhoneNum(userName, phoneNum, result, JSON.toJSONString(ExistAnswerList), 0L, testType);
        if (update != 1) {
            throw new Exception("更新结果表时出现异常");
        }
        //2.0更新名单表
        testUserListService.updateStatusByUserNameAndPhoneNum(userName, phoneNum, testType, -1);
        return update;
    }

    /**
     * 输入名字（花名）和手机号获得题目
     *
     * @param userName 名字（姓名 /花名）
     * @param phoneNum 电话号码
     * @return
     */
    @Override
    public LinkedHashMap<String, Object> getStatusAndQuestionByNameAndPhone(String userName, String phoneNum) throws Exception {
        LinkedHashMap<String, Object> map = new LinkedHashMap<>();//返回的结果
        //首先在名单里查询是否有这个人，如果有这个人
        List<LinkedHashMap<String, Object>> status = testUserListService.getStatusAndTestTypeByNameAndPhone(userName, phoneNum);

        //有测评资格者，获取测评的类型和测评状态
        //如果测评的状态是-1代表已经答题结束，0为未答题，1为正在答题
        int testStatus = Integer.parseInt(status.get(0).get("status").toString());
        if (testStatus == -1) {
            //已经完成答题了
            throw new Exception("您已经完成测评，无需重复测评");
        }

        //如果是状态是0（未答题）,返回所有的题
        //题目类型，
        String questionString = "";
        int testType = Integer.parseInt(status.get(0).get("testType").toString());
        if (testStatus == 0) {
            //未答题
            if (testType == 180) {
                //180题的类型
                questionString = testQuestion180Service.getAllQuestion();
                //将题目和开始id返回给页面；
                map.put("questionString", questionString);
                map.put("testType", 180);
            } else if (testType == 93) {
                //93题的类型
                questionString = testQuestion93Service.getAllQuestion();
                //将题目和开始id返回给页面；
                map.put("questionString", questionString);
                map.put("testType", 93);
            } else if (testType == 7) {
                //7题的类型
                questionString = testQuestion7Service.getAllQuestion();
                //将题目和开始id返回给页面；
                map.put("questionString", questionString);
                map.put("testType", 7);
            }
            map.put("startId", 1);
            return map;
        }

        //已经开始答题了status=1
        //1.从答案表里查询答案的数量
        List<LinkedHashMap<String, Object>> answers = testResultMapper.getAnswerByUserNameAndPhoneNum(userName, phoneNum, testType);
        if (answers == null || answers.size() < 1) {
            throw new Exception("通过该姓名和手机号搜索不到答案记录,姓名为:" + userName + ",手机号为:" + phoneNum);
        }
        //结果不为空，获取答案的数量
        String answer = answers.get(0).get("answer").toString();
        List<String> answerList = JSON.parseArray(answer, String.class);
        //获取从该id接下来的题目
        if (testType == 180) {
            questionString = testQuestion180Service.selectQuestionByStartID(answerList.size());
            map.put("questionString", questionString);//题目字符串
        } else if (testType == 93) {
            questionString = testQuestion93Service.selectQuestionByStartID(answerList.size());
            map.put("questionString", questionString);//题目字符串
        } else if (testType == 7) {
            questionString = testQuestion7Service.selectQuestionByStartID(answerList.size());
            map.put("questionString", questionString);//题目字符串
        }
        map.put("startId", answerList.size() + 1);//开始题号
        map.put("breakTime", answers.get(0).get("breakTime"));//中断时间
        map.put("testType",testType);
        return map;
    }

    /**
     * 通过id获取结果记录对象
     *
     * @param id 结果记录id
     * @return
     * @throws Exception
     */
    @Override
    public HashMap<String, String> getResultById(Long id) throws Exception {
        List<LinkedHashMap<String, Object>> testResults = testResultMapper.getResultById(id);
        if (testResults == null || testResults.size() < 1) {
            throw new Exception("通过该id：" + id + "查询不到结果");
        }
        LinkedHashMap<String, Object> data = testResults.get(0);

        HashMap<String, String> info = new HashMap<>();

        info.put("userName", data.get("userName").toString());
        info.put("cDate", data.get("cDate").toString());
        String result = data.get("result").toString();

        int testType = Integer.parseInt(data.get("testType").toString());
        //result还原成map

        LinkedHashMap<String, Object> analysis = new LinkedHashMap<>();
        String analysisString = "";//分析的字符串
        String infoString = JSON.toJSONString(info);//基本信息
        if (testType == 180) {
            LinkedHashMap<String, Object> map = JSON.parseObject(result, LinkedHashMap.class);
            //遍历map取五个值
            int count = 0;
            //用字节码获取字段
            CharacterAnalysis aInstance = new CharacterAnalysis();
            Class<?> c = Class.forName("com.deli.entity.CharacterAnalysis");
            for (String key : map.keySet()) {
                if (count <= 4) {
                    //获取类的字节码文件对象
                    Field field = c.getDeclaredField(key);
                    System.out.println("field:" + field);
                    String value = (String) field.get(aInstance);
                    analysis.put(key, value);
                    count++;//每获得一个加一
                } else {
                    break;
                }
            }
            analysisString = JSON.toJSONString(analysis);

        } else if (testType == 93) {
            ArrayList<JSONObject> arrayList = JSON.parseObject(result, ArrayList.class);

            int E = 0;
            int I = 0;
            int S = 0;
            int N = 0;
            int T = 0;
            int F = 0;
            int J = 0;
            int P = 0;
            for (JSONObject jsonObject : arrayList) {
                for (String key : jsonObject.keySet()) {
                    if (key.startsWith("E")) {
                        E = Integer.parseInt(jsonObject.get(key).toString());
                    } else if (key.startsWith("I")) {
                        I = Integer.parseInt(jsonObject.get(key).toString());
                    } else if (key.startsWith("S")) {
                        S = Integer.parseInt(jsonObject.get(key).toString());
                    } else if (key.startsWith("N")) {
                        N = Integer.parseInt(jsonObject.get(key).toString());
                    } else if (key.startsWith("T")) {
                        T = Integer.parseInt(jsonObject.get(key).toString());
                    } else if (key.startsWith("F")) {
                        F = Integer.parseInt(jsonObject.get(key).toString());
                    } else if (key.startsWith("J")) {
                        J = Integer.parseInt(jsonObject.get(key).toString());
                    } else if (key.startsWith("P")) {
                        P = Integer.parseInt(jsonObject.get(key).toString());
                    }
                }
            }
            result = "";
            if (I >= E) {
                result += "I";
            } else {
                result += "E";
            }

            if (N >= S) {
                result += "N";
            } else {
                result += "S";
            }

            if (F >= T) {
                result += "F";
            } else {
                result += "T";
            }

            if (P >= J) {
                result += "P";
            } else {
                result += "J";
            }

            analysis = testAnalysis93Service.getAnalysisByName(result);
            analysisString = JSON.toJSONString(analysis);
        } else if (testType == 7) {
            ArrayList<JSONObject> arrayList = JSON.parseObject(result, ArrayList.class);
            for (String key : arrayList.get(0).keySet()) {
                analysis = testAnalysis7Service.getAnalysisByName(key);
                analysisString = JSON.toJSONString(analysis);
            }


        }
        HashMap<String, String> dataMap = new HashMap<>();
        dataMap.put("analysis", analysisString);
        dataMap.put("info", infoString);
        dataMap.put("result", result);
        return dataMap;
    }

    /**
     * 查询报表
     *
     * @param userName       姓名
     * @param departmentname 部门（模糊）
     * @param mobilePhone    手机号
     * @param textfield      花名
     * @param userPosition   岗位（模糊）
     * @param testType       测试类型
     * @param managername    上级名字
     * @param startDateTime  开始时间
     * @param endDateTime    结束时间
     * @param pageNum        页码
     * @return
     * @throws Exception
     */
    @Override
    public List<LinkedHashMap<String, Object>> getExport(String userName, String departmentname, String mobilePhone, String textfield,
                                                         String userPosition, Integer testType, String managername, Long startDateTime,
                                                         Long endDateTime, int pageNum) throws Exception {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault());
        Calendar c = Calendar.getInstance();

        String startTime = "";
        String endTime = "";
        if (startDateTime != null && startDateTime > 0) {
            //有开始时间
            c.setTime(new Date(startDateTime));
            startTime = sdf.format(c.getTime());
        }
        if (endDateTime != null && endDateTime > 0) {
            //有开始时间
            c.setTime(new Date(endDateTime));
            endTime = sdf.format(c.getTime());
        }
        pageNum = Integer.valueOf((pageNum - 1) * 10);

        List<LinkedHashMap<String, Object>> dataList = new ArrayList<>();
        Integer totaldataCount = 0;
        if (StringUtils.isBlank(startTime) && StringUtils.isBlank(endTime)) {
            //都没有
            dataList = testResultMapper.getExport(userName, departmentname, mobilePhone, textfield, userPosition, testType, managername, pageNum);//数据
            totaldataCount = testResultMapper.getExportCount(userName, departmentname, mobilePhone, textfield, userPosition, testType, managername);

            //总数量
        } else if (StringUtils.isBlank(startTime) && StringUtils.isNotBlank(endTime)) {
            //没有开始时间，有结束时间
            dataList = testResultMapper.getExportWithEndTime(userName, departmentname, mobilePhone, textfield, userPosition, testType, managername, endTime, pageNum);
            totaldataCount = testResultMapper.getExportWithEndTimeCount(userName, departmentname, mobilePhone, textfield, userPosition, testType, managername, endTime);
        } else if (StringUtils.isNotBlank(startTime) && StringUtils.isBlank(endTime)) {
            //有开始时间，没有结束时间
            dataList = testResultMapper.getExportWithStartTime(userName, departmentname, mobilePhone, textfield, userPosition, testType, managername, startTime, pageNum);
            totaldataCount = testResultMapper.getExportWithStartTimeCount(userName, departmentname, mobilePhone, textfield, userPosition, testType, managername, startTime);
        } else {
            //有开始时间，有结束时间
            dataList = testResultMapper.getExportWithStartTimeAndEndTime(userName, departmentname, mobilePhone, textfield, userPosition, testType, managername, startTime, endTime, pageNum);
            totaldataCount = testResultMapper.getExportWithStartTimeAndEndTimeCount(userName, departmentname, mobilePhone, textfield, userPosition, testType, managername, startTime, endTime);
        }

        if (dataList == null || dataList.size() < 1) {
            throw new Exception("后台查询报表：根据该条件查询不到结果记录");
        }
        dataList.get(0).put("totaldataCount", totaldataCount);//总个数
        return dataList;
    }

    @Override
    public HashMap<String, String> characterAnalysisShow(String characterName) throws ClassNotFoundException, NoSuchFieldException, IllegalAccessException {
        LinkedHashMap<String, String> map = new LinkedHashMap<>();
        CharacterAnalysis aInstance = new CharacterAnalysis();
        Class<?> c = Class.forName("com.deli.entity.CharacterAnalysis");
        Field field = c.getDeclaredField(characterName);
        String value = (String) field.get(aInstance);
        map.put(characterName, value);
        return map;
    }

    /**
     * 用答案的List集合获得结果的String(180)
     *
     * @param ExistAnswerList 答案的list集合（180题的）
     * @return
     * @throws Exception
     */
    public String getResultByAnswerList180(ArrayList<String> ExistAnswerList) throws Exception {
        //是180题
        //遍历判断180个值是否全相同
        //定义一个标记
        boolean flag = true;//默认是相同的
        for (int i = 1; i < ExistAnswerList.size(); i++) {
            if (!ExistAnswerList.get(i - 1).equals(ExistAnswerList.get(i))) {
                flag = false;
            }
            if (flag == false) {
                break;
            }
        }
        if (flag == true) {
            //所有的都是相同的
            throw new Exception("您好，系统检测到您提交的测试结果异常，请重新答题。");

        }

        //把对象放入集合
        ArrayList<Answer> answers = new ArrayList<>();
        for (String answerString : ExistAnswerList) {
            Answer answerPojo = new Answer();
            if (answerString.equals("3A")) {
                answerPojo.setScoreA(3);
            } else if (answerString.equals("2A")) {
                answerPojo.setScoreA(2);
            } else if (answerString.equals("1")) {
                answerPojo.setScoreCenter(1);
            } else if (answerString.equals("2B")) {
                answerPojo.setScoreB(2);
            } else if (answerString.equals("3B")) {
                answerPojo.setScoreB(3);
            }
            answers.add(answerPojo);
        }

        //成就 Achiever
        Double Achiever = (answers.get(3).getScoreCenter() + answers.get(3).getScoreA()
                + answers.get(4).getScoreCenter() + answers.get(4).getScoreA()
                + answers.get(23).getScoreCenter() + answers.get(23).getScoreB()
                + answers.get(27).getScoreCenter() + answers.get(27).getScoreA()
                + answers.get(45).getScoreCenter() + answers.get(45).getScoreB()

                + answers.get(65).getScoreCenter() + answers.get(65).getScoreA()
                + answers.get(85).getScoreCenter() + answers.get(85).getScoreA()
                + answers.get(103).getScoreCenter() + answers.get(103).getScoreB()
                + answers.get(108).getScoreCenter() + answers.get(108).getScoreA()
                + answers.get(109).getScoreCenter() + answers.get(109).getScoreB()

                + answers.get(124).getScoreCenter() + answers.get(124).getScoreB()
                + answers.get(130).getScoreCenter() + answers.get(130).getScoreB()
                + answers.get(133).getScoreCenter() + answers.get(133).getScoreB()
                + answers.get(135).getScoreCenter() + answers.get(135).getScoreB()
                + answers.get(141).getScoreCenter() + answers.get(141).getScoreB()

                + answers.get(142).getScoreCenter() + answers.get(142).getScoreB()
                + answers.get(148).getScoreCenter() + answers.get(148).getScoreA()
                + answers.get(159).getScoreCenter() + answers.get(159).getScoreA()
                + answers.get(166).getScoreCenter() + answers.get(166).getScoreA()) / 19.0;
        BigDecimal b = new BigDecimal(Achiever);
        Achiever = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

        //行动 Activator
        Double Activator = (answers.get(19).getScoreCenter() + answers.get(19).getScoreA()
                + answers.get(34).getScoreCenter() + answers.get(34).getScoreB()
                + answers.get(37).getScoreCenter() + answers.get(37).getScoreA()
                + answers.get(39).getScoreCenter() + answers.get(39).getScoreB()
                + answers.get(44).getScoreCenter() + answers.get(44).getScoreA()
                + answers.get(46).getScoreCenter() + answers.get(46).getScoreA()
                + answers.get(47).getScoreCenter() + answers.get(47).getScoreA()
                + answers.get(83).getScoreCenter() + answers.get(83).getScoreB()
                + answers.get(84).getScoreCenter() + answers.get(84).getScoreA()
                + answers.get(89).getScoreCenter() + answers.get(89).getScoreB()
                + answers.get(93).getScoreCenter() + answers.get(93).getScoreA()
                + answers.get(95).getScoreCenter() + answers.get(95).getScoreB()
                + answers.get(99).getScoreCenter() + answers.get(99).getScoreA()
                + answers.get(132).getScoreCenter() + answers.get(132).getScoreB()
                + answers.get(143).getScoreCenter() + answers.get(143).getScoreA()
                + answers.get(152).getScoreCenter() + answers.get(152).getScoreB()
                + answers.get(155).getScoreCenter() + answers.get(155).getScoreB()
                + answers.get(157).getScoreCenter() + answers.get(157).getScoreB()) / 18.0;
        b = new BigDecimal(Activator);
        Activator = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

        //适应 Adaptability
        Double Adaptability = (answers.get(20).getScoreCenter() + answers.get(20).getScoreB()
                + answers.get(21).getScoreCenter() + answers.get(21).getScoreB()
                + answers.get(33).getScoreCenter() + answers.get(33).getScoreB()
                + answers.get(35).getScoreCenter() + answers.get(35).getScoreB()
                + answers.get(41).getScoreCenter() + answers.get(41).getScoreA()

                + answers.get(49).getScoreCenter() + answers.get(49).getScoreB()
                + answers.get(56).getScoreCenter() + answers.get(56).getScoreB()
                + answers.get(71).getScoreCenter() + answers.get(71).getScoreA()
                + answers.get(73).getScoreCenter() + answers.get(73).getScoreA()
                + answers.get(74).getScoreCenter() + answers.get(74).getScoreB()

                + answers.get(78).getScoreCenter() + answers.get(78).getScoreB()
                + answers.get(96).getScoreCenter() + answers.get(96).getScoreA()
                + answers.get(121).getScoreCenter() + answers.get(121).getScoreA()
                + answers.get(126).getScoreCenter() + answers.get(126).getScoreA()
                + answers.get(146).getScoreCenter() + answers.get(146).getScoreA()

                + answers.get(151).getScoreCenter() + answers.get(151).getScoreA()
                + answers.get(174).getScoreCenter() + answers.get(174).getScoreA()
                + answers.get(178).getScoreCenter() + answers.get(178).getScoreB()) / 18.0;
        b = new BigDecimal(Adaptability);
        Adaptability = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

        //分析Analytical
        Double Analytical = (answers.get(0).getScoreCenter() + answers.get(0).getScoreB()
                + answers.get(6).getScoreCenter() + answers.get(6).getScoreB()
                + answers.get(26).getScoreCenter() + answers.get(26).getScoreB()
                + answers.get(37).getScoreCenter() + answers.get(37).getScoreB()
                + answers.get(41).getScoreCenter() + answers.get(41).getScoreB()

                + answers.get(42).getScoreCenter() + answers.get(42).getScoreA()
                + answers.get(54).getScoreCenter() + answers.get(54).getScoreA()
                + answers.get(70).getScoreCenter() + answers.get(70).getScoreB()
                + answers.get(77).getScoreCenter() + answers.get(77).getScoreA()
                + answers.get(84).getScoreCenter() + answers.get(84).getScoreA()

                + answers.get(111).getScoreCenter() + answers.get(111).getScoreB()
                + answers.get(132).getScoreCenter() + answers.get(132).getScoreA()
                + answers.get(133).getScoreCenter() + answers.get(133).getScoreA()
                + answers.get(139).getScoreCenter() + answers.get(139).getScoreA()
                + answers.get(153).getScoreCenter() + answers.get(153).getScoreA()

                + answers.get(156).getScoreCenter() + answers.get(156).getScoreB()
                + answers.get(159).getScoreCenter() + answers.get(159).getScoreB()
                + answers.get(164).getScoreCenter() + answers.get(164).getScoreA()
                + answers.get(165).getScoreCenter() + answers.get(165).getScoreA()) / 19.0;
        b = new BigDecimal(Analytical);
        Analytical = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
        System.out.print("分析 Analytical:" + Analytical);

        //统筹 Arranger
        Double Arranger = (answers.get(6).getScoreCenter() + answers.get(6).getScoreB()
                + answers.get(31).getScoreCenter() + answers.get(31).getScoreB()
                + answers.get(32).getScoreCenter() + answers.get(32).getScoreB()
                + answers.get(61).getScoreCenter() + answers.get(61).getScoreB()
                + answers.get(71).getScoreCenter() + answers.get(71).getScoreB()

                + answers.get(78).getScoreCenter() + answers.get(78).getScoreA()
                + answers.get(86).getScoreCenter() + answers.get(86).getScoreA()
                + answers.get(93).getScoreCenter() + answers.get(93).getScoreB()
                + answers.get(125).getScoreCenter() + answers.get(125).getScoreA()
                + answers.get(146).getScoreCenter() + answers.get(146).getScoreB()

                + answers.get(149).getScoreCenter() + answers.get(149).getScoreA()
                + answers.get(150).getScoreCenter() + answers.get(150).getScoreA()
                + answers.get(152).getScoreCenter() + answers.get(152).getScoreB()
                + answers.get(173).getScoreCenter() + answers.get(173).getScoreA()
                + answers.get(174).getScoreCenter() + answers.get(174).getScoreA()) / 15.0;
        b = new BigDecimal(Arranger);
        Arranger = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

        //信仰 Belief
        Double Belief = (answers.get(0).getScoreCenter() + answers.get(0).getScoreA()
                + answers.get(6).getScoreCenter() + answers.get(6).getScoreA()
                + answers.get(12).getScoreCenter() + answers.get(12).getScoreA()
                + answers.get(15).getScoreCenter() + answers.get(15).getScoreB()
                + answers.get(29).getScoreCenter() + answers.get(29).getScoreB()

                + answers.get(35).getScoreCenter() + answers.get(35).getScoreA()
                + answers.get(79).getScoreCenter() + answers.get(79).getScoreA()
                + answers.get(86).getScoreCenter() + answers.get(86).getScoreB()
                + answers.get(96).getScoreCenter() + answers.get(96).getScoreB()
                + answers.get(107).getScoreCenter() + answers.get(107).getScoreB()

                + answers.get(118).getScoreCenter() + answers.get(118).getScoreB()
                + answers.get(126).getScoreCenter() + answers.get(126).getScoreB()
                + answers.get(127).getScoreCenter() + answers.get(127).getScoreA()
                + answers.get(159).getScoreCenter() + answers.get(159).getScoreA()
                + answers.get(161).getScoreCenter() + answers.get(161).getScoreB()

                + answers.get(167).getScoreCenter() + answers.get(167).getScoreA()
                + answers.get(170).getScoreCenter() + answers.get(170).getScoreB()) / 17.0;
        b = new BigDecimal(Belief);
        Belief = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

        //统率 Command
        Double Command = (answers.get(6).getScoreCenter() + answers.get(6).getScoreB()
                + answers.get(11).getScoreCenter() + answers.get(11).getScoreB()
                + answers.get(13).getScoreCenter() + answers.get(13).getScoreB()
                + answers.get(14).getScoreCenter() + answers.get(14).getScoreA()
                + answers.get(27).getScoreCenter() + answers.get(27).getScoreA()

                + answers.get(28).getScoreCenter() + answers.get(28).getScoreA() - answers.get(28).getScoreB()
                + answers.get(37).getScoreCenter() + answers.get(37).getScoreA()
                + answers.get(47).getScoreCenter() + answers.get(47).getScoreB()
                + answers.get(58).getScoreCenter() + answers.get(58).getScoreB()
                + answers.get(61).getScoreCenter() + answers.get(61).getScoreB()

                + answers.get(80).getScoreCenter() + answers.get(80).getScoreA()
                + answers.get(93).getScoreCenter() + answers.get(93).getScoreB()
                + answers.get(103).getScoreCenter() + answers.get(103).getScoreA()
                + answers.get(152).getScoreCenter() + answers.get(152).getScoreA()
                + answers.get(153).getScoreCenter() + answers.get(153).getScoreB()) / 15.0;
        b = new BigDecimal(Command);
        Command = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

        //沟通  Communication
        Double Communication = (answers.get(22).getScoreCenter() + answers.get(22).getScoreA()
                + answers.get(38).getScoreCenter() + answers.get(38).getScoreA()
                + answers.get(43).getScoreCenter() + answers.get(43).getScoreA()
                + answers.get(68).getScoreCenter() + answers.get(68).getScoreB()
                + answers.get(81).getScoreCenter() + answers.get(81).getScoreA()

                + answers.get(82).getScoreCenter() + answers.get(82).getScoreA()
                + answers.get(87).getScoreCenter() + answers.get(87).getScoreA()
                + answers.get(88).getScoreCenter() + answers.get(88).getScoreB()
                + answers.get(94).getScoreCenter() + answers.get(94).getScoreA()
                + answers.get(98).getScoreCenter() + answers.get(98).getScoreB()

                + answers.get(117).getScoreCenter() + answers.get(117).getScoreA()
                + answers.get(138).getScoreCenter() + answers.get(138).getScoreB()
                + answers.get(144).getScoreCenter() + answers.get(144).getScoreA()
                + answers.get(151).getScoreCenter() + answers.get(151).getScoreA()
                + answers.get(156).getScoreCenter() + answers.get(156).getScoreA()
                + answers.get(176).getScoreCenter() + answers.get(176).getScoreB()) / 16.0;
        b = new BigDecimal(Communication);
        Communication = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

        //竞争 Competition
        Double Competition = (answers.get(3).getScoreCenter() + answers.get(3).getScoreA()
                + answers.get(24).getScoreCenter() + answers.get(24).getScoreA()
                + answers.get(52).getScoreCenter() + answers.get(52).getScoreB()
                + answers.get(65).getScoreCenter() + answers.get(65).getScoreA()
                + answers.get(83).getScoreCenter() + answers.get(83).getScoreA()

                + answers.get(85).getScoreCenter() + answers.get(85).getScoreA()
                + answers.get(137).getScoreCenter() + answers.get(137).getScoreA()
                + answers.get(138).getScoreCenter() + answers.get(138).getScoreA()
                + answers.get(142).getScoreCenter() + answers.get(142).getScoreB()
                + answers.get(144).getScoreCenter() + answers.get(144).getScoreA()

                + answers.get(148).getScoreCenter() + answers.get(148).getScoreA()
                + answers.get(149).getScoreCenter() + answers.get(149).getScoreA()
                + answers.get(154).getScoreCenter() + answers.get(154).getScoreB()
                + answers.get(166).getScoreCenter() + answers.get(166).getScoreA()
                + answers.get(172).getScoreCenter() + answers.get(172).getScoreB()) / 15.0;
        b = new BigDecimal(Competition);
        Competition = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

        //关联 Connectedness
        Double Connectedness = (answers.get(21).getScoreCenter() + answers.get(21).getScoreA()
                + answers.get(25).getScoreCenter() + answers.get(25).getScoreA()
                + answers.get(42).getScoreCenter() + answers.get(42).getScoreB()
                + answers.get(52).getScoreCenter() + answers.get(52).getScoreA()
                + answers.get(58).getScoreCenter() + answers.get(58).getScoreA()

                + answers.get(60).getScoreCenter() + answers.get(60).getScoreB()
                + answers.get(61).getScoreCenter() + answers.get(61).getScoreA()
                + answers.get(77).getScoreCenter() + answers.get(77).getScoreA()
                + answers.get(111).getScoreCenter() + answers.get(111).getScoreB()
                + answers.get(112).getScoreCenter() + answers.get(112).getScoreA()

                + answers.get(133).getScoreCenter() + answers.get(133).getScoreA()
                + answers.get(138).getScoreCenter() + answers.get(138).getScoreB()
                + answers.get(144).getScoreCenter() + answers.get(144).getScoreA()
                + answers.get(151).getScoreCenter() + answers.get(151).getScoreA()
                + answers.get(163).getScoreCenter() + answers.get(163).getScoreB()

                + answers.get(168).getScoreCenter() + answers.get(168).getScoreB()
                + answers.get(169).getScoreCenter() + answers.get(169).getScoreB()
                + answers.get(179).getScoreCenter() + answers.get(179).getScoreB()) / 18.0;
        b = new BigDecimal(Connectedness);
        Connectedness = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

        //回顾 Context
        Double Context = (answers.get(1).getScoreCenter() + answers.get(1).getScoreB()
                + answers.get(33).getScoreCenter() + answers.get(33).getScoreA()
                + answers.get(53).getScoreCenter() + answers.get(53).getScoreA()
                + answers.get(54).getScoreCenter() + answers.get(54).getScoreA()
                + answers.get(55).getScoreCenter() + answers.get(55).getScoreB()

                + answers.get(81).getScoreCenter() + answers.get(81).getScoreA()
                + answers.get(111).getScoreCenter() + answers.get(111).getScoreB()
                + answers.get(124).getScoreCenter() + answers.get(124).getScoreA()
                + answers.get(129).getScoreCenter() + answers.get(129).getScoreB()
                + answers.get(133).getScoreCenter() + answers.get(133).getScoreA()

                + answers.get(139).getScoreCenter() + answers.get(139).getScoreA()
                + answers.get(171).getScoreCenter() + answers.get(171).getScoreA()
                + answers.get(172).getScoreCenter() + answers.get(172).getScoreA()
                + answers.get(175).getScoreCenter() + answers.get(175).getScoreA()
                + answers.get(176).getScoreCenter() + answers.get(176).getScoreA()) / 15.0;
        b = new BigDecimal(Context);
        Context = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

        //审慎 Deliberative
        Double Deliberative = (answers.get(6).getScoreCenter() + answers.get(6).getScoreB()
                + answers.get(8).getScoreCenter() + answers.get(8).getScoreA()
                + answers.get(16).getScoreCenter() + answers.get(16).getScoreA()
                + answers.get(19).getScoreCenter() + answers.get(19).getScoreB()
                + answers.get(26).getScoreCenter() + answers.get(26).getScoreA()

                + answers.get(31).getScoreCenter() + answers.get(31).getScoreB()
                + answers.get(41).getScoreCenter() + answers.get(41).getScoreB()
                + answers.get(42).getScoreCenter() + answers.get(42).getScoreA()
                + answers.get(50).getScoreCenter() + answers.get(50).getScoreB()
                + answers.get(51).getScoreCenter() + answers.get(51).getScoreB()

                + answers.get(64).getScoreCenter() + answers.get(64).getScoreB()
                + answers.get(67).getScoreCenter() + answers.get(67).getScoreA()
                + answers.get(69).getScoreCenter() + answers.get(69).getScoreB()
                + answers.get(70).getScoreCenter() + answers.get(70).getScoreB()
                + answers.get(90).getScoreCenter() + answers.get(90).getScoreB() - answers.get(90).getScoreA()

                + answers.get(101).getScoreCenter() + answers.get(101).getScoreA()
                + answers.get(102).getScoreCenter() + answers.get(102).getScoreA()
                + answers.get(104).getScoreCenter() + answers.get(104).getScoreB()
                + answers.get(106).getScoreCenter() + answers.get(106).getScoreA()
                + answers.get(144).getScoreCenter() + answers.get(144).getScoreB()) / 20.0;
        b = new BigDecimal(Deliberative);
        Deliberative = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

        //伯乐 Developer
        Double Developer = (answers.get(11).getScoreCenter() + answers.get(11).getScoreA()
                + answers.get(23).getScoreCenter() + answers.get(23).getScoreA()
                + answers.get(27).getScoreCenter() + answers.get(27).getScoreB()
                + answers.get(30).getScoreCenter() + answers.get(30).getScoreA()
                + answers.get(32).getScoreCenter() + answers.get(32).getScoreB()

                + answers.get(81).getScoreCenter() + answers.get(81).getScoreB()
                + answers.get(100).getScoreCenter() + answers.get(100).getScoreB()
                + answers.get(117).getScoreCenter() + answers.get(117).getScoreB()
                + answers.get(122).getScoreCenter() + answers.get(122).getScoreA()
                + answers.get(136).getScoreCenter() + answers.get(136).getScoreB()

                + answers.get(140).getScoreCenter() + answers.get(140).getScoreA()
                + answers.get(144).getScoreCenter() + answers.get(144).getScoreB()
                + answers.get(172).getScoreCenter() + answers.get(172).getScoreA()
                + answers.get(173).getScoreCenter() + answers.get(173).getScoreB()
                + answers.get(176).getScoreCenter() + answers.get(176).getScoreA() + answers.get(176).getScoreB()
                + answers.get(179).getScoreCenter() + answers.get(179).getScoreB()) / 16.0;
        b = new BigDecimal(Developer);
        Developer = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

        //纪律 Discipline
        Double Discipline = (answers.get(49).getScoreCenter() + answers.get(49).getScoreA()
                + answers.get(56).getScoreCenter() + answers.get(56).getScoreA()
                + answers.get(57).getScoreCenter() + answers.get(57).getScoreB()
                + answers.get(59).getScoreCenter() + answers.get(59).getScoreB()
                + answers.get(74).getScoreCenter() + answers.get(74).getScoreA()

                + answers.get(76).getScoreCenter() + answers.get(76).getScoreA()
                + answers.get(78).getScoreCenter() + answers.get(78).getScoreA()
                + answers.get(90).getScoreCenter() + answers.get(90).getScoreA()
                + answers.get(96).getScoreCenter() + answers.get(96).getScoreB()
                + answers.get(98).getScoreCenter() + answers.get(98).getScoreA()

                + answers.get(114).getScoreCenter() + answers.get(114).getScoreB()
                + answers.get(116).getScoreCenter() + answers.get(116).getScoreB()
                + answers.get(121).getScoreCenter() + answers.get(121).getScoreB()
                + answers.get(142).getScoreCenter() + answers.get(142).getScoreB()
                + answers.get(161).getScoreCenter() + answers.get(161).getScoreA()

                + answers.get(166).getScoreCenter() + answers.get(166).getScoreB()
                + answers.get(174).getScoreCenter() + answers.get(174).getScoreB()) / 17.0;
        b = new BigDecimal(Discipline);
        Discipline = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

        //体谅 Empathy
        Double Empathy = (answers.get(0).getScoreCenter() + answers.get(0).getScoreA()
                + answers.get(6).getScoreCenter() + answers.get(6).getScoreA()
                + answers.get(7).getScoreCenter() + answers.get(7).getScoreA()
                + answers.get(14).getScoreCenter() + answers.get(14).getScoreB()
                + answers.get(22).getScoreCenter() + answers.get(22).getScoreB()
                + answers.get(29).getScoreCenter() + answers.get(29).getScoreA()
                + answers.get(38).getScoreCenter() + answers.get(38).getScoreA()
                + answers.get(68).getScoreCenter() + answers.get(68).getScoreA()
                + answers.get(72).getScoreCenter() + answers.get(72).getScoreA()
                + answers.get(80).getScoreCenter() + answers.get(80).getScoreB()
                + answers.get(91).getScoreCenter() + answers.get(91).getScoreA()
                + answers.get(94).getScoreCenter() + answers.get(94).getScoreB()
                + answers.get(128).getScoreCenter() + answers.get(128).getScoreA()
                + answers.get(144).getScoreCenter() + answers.get(144).getScoreA()
                + answers.get(146).getScoreCenter() + answers.get(146).getScoreA()) / 15.0;
        b = new BigDecimal(Empathy);
        Empathy = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

        //公平 fairness
        Double fairness = (answers.get(6).getScoreCenter() + answers.get(6).getScoreA()
                + answers.get(7).getScoreCenter() + answers.get(7).getScoreB()
                + answers.get(29).getScoreCenter() + answers.get(29).getScoreB()
                + answers.get(51).getScoreCenter() + answers.get(51).getScoreA()
                + answers.get(57).getScoreCenter() + answers.get(57).getScoreB()

                + answers.get(62).getScoreCenter() + answers.get(62).getScoreA()
                + answers.get(66).getScoreCenter() + answers.get(66).getScoreB()
                + answers.get(90).getScoreCenter() + answers.get(90).getScoreA()
                + answers.get(91).getScoreCenter() + answers.get(91).getScoreB()
                + answers.get(128).getScoreCenter() + answers.get(128).getScoreA()

                + answers.get(136).getScoreCenter() + answers.get(136).getScoreA()
                + answers.get(138).getScoreCenter() + answers.get(138).getScoreA()
                + answers.get(140).getScoreCenter() + answers.get(140).getScoreB()
                + answers.get(144).getScoreCenter() + answers.get(144).getScoreA()
                + answers.get(166).getScoreCenter() + answers.get(166).getScoreB()
                + answers.get(174).getScoreCenter() + answers.get(174).getScoreB()) / 16.0;
        b = new BigDecimal(fairness);
        fairness = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

        //专注 Focus
        Double Focus = (answers.get(20).getScoreCenter() + answers.get(20).getScoreA()
                + answers.get(73).getScoreCenter() + answers.get(73).getScoreA()
                + answers.get(74).getScoreCenter() + answers.get(74).getScoreA()
                + answers.get(75).getScoreCenter() + answers.get(75).getScoreB()
                + answers.get(78).getScoreCenter() + answers.get(78).getScoreA()

                + answers.get(105).getScoreCenter() + answers.get(105).getScoreA() - answers.get(105).getScoreB()
                + answers.get(113).getScoreCenter() + answers.get(113).getScoreB()
                + answers.get(129).getScoreCenter() + answers.get(129).getScoreA()
                + answers.get(139).getScoreCenter() + answers.get(139).getScoreB()
                + answers.get(141).getScoreCenter() + answers.get(141).getScoreB()

                + answers.get(145).getScoreCenter() + answers.get(145).getScoreB()
                + answers.get(147).getScoreCenter() + answers.get(147).getScoreA()
                + answers.get(150).getScoreCenter() + answers.get(150).getScoreB()
                + answers.get(153).getScoreCenter() + answers.get(153).getScoreA()
                + answers.get(162).getScoreCenter() + answers.get(162).getScoreB()
                + answers.get(164).getScoreCenter() + answers.get(164).getScoreA()) / 16.0;
        b = new BigDecimal(Focus);
        Focus = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

        // 前瞻 Futuristic
        Double Futuristic = (answers.get(1).getScoreCenter() + answers.get(1).getScoreA()
                + answers.get(15).getScoreCenter() + answers.get(15).getScoreA()
                + answers.get(17).getScoreCenter() + answers.get(17).getScoreA()
                + answers.get(34).getScoreCenter() + answers.get(34).getScoreA()
                + answers.get(50).getScoreCenter() + answers.get(50).getScoreA()

                + answers.get(53).getScoreCenter() + answers.get(53).getScoreB()
                + answers.get(54).getScoreCenter() + answers.get(54).getScoreB()
                + answers.get(73).getScoreCenter() + answers.get(73).getScoreB()
                + answers.get(74).getScoreCenter() + answers.get(74).getScoreA()
                + answers.get(99).getScoreCenter() + answers.get(99).getScoreB()

                + answers.get(111).getScoreCenter() + answers.get(111).getScoreA()
                + answers.get(124).getScoreCenter() + answers.get(124).getScoreB()
                + answers.get(137).getScoreCenter() + answers.get(137).getScoreB()
                + answers.get(171).getScoreCenter() + answers.get(171).getScoreB()
                + answers.get(175).getScoreCenter() + answers.get(175).getScoreB()
                + answers.get(176).getScoreCenter() + answers.get(176).getScoreB()) / 16.0;
        b = new BigDecimal(Futuristic);
        Futuristic = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

        //和谐 Harmony
        Double Harmony = (answers.get(18).getScoreCenter() + answers.get(18).getScoreB()
                + answers.get(28).getScoreCenter() + answers.get(28).getScoreB()
                + answers.get(32).getScoreCenter() + answers.get(32).getScoreA()
                + answers.get(49).getScoreCenter() + answers.get(49).getScoreB()
                + answers.get(51).getScoreCenter() + answers.get(51).getScoreA()

                + answers.get(61).getScoreCenter() + answers.get(61).getScoreA()
                + answers.get(66).getScoreCenter() + answers.get(66).getScoreA()
                + answers.get(68).getScoreCenter() + answers.get(68).getScoreA()
                + answers.get(87).getScoreCenter() + answers.get(87).getScoreB()
                + answers.get(130).getScoreCenter() + answers.get(130).getScoreA()

                + answers.get(138).getScoreCenter() + answers.get(138).getScoreB()
                + answers.get(144).getScoreCenter() + answers.get(144).getScoreA()
                + answers.get(146).getScoreCenter() + answers.get(146).getScoreA()
                + answers.get(149).getScoreCenter() + answers.get(149).getScoreB()
                + answers.get(158).getScoreCenter() + answers.get(158).getScoreA()
                + answers.get(168).getScoreCenter() + answers.get(168).getScoreB()) / 16.0;
        b = new BigDecimal(Harmony);
        Harmony = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

        //理念 Ideation
        Double Ideation = (answers.get(25).getScoreCenter() + answers.get(25).getScoreB()
                + answers.get(39).getScoreCenter() + answers.get(39).getScoreA()
                + answers.get(46).getScoreCenter() + answers.get(46).getScoreB()
                + answers.get(84).getScoreCenter() + answers.get(84).getScoreB()
                + answers.get(88).getScoreCenter() + answers.get(88).getScoreA()

                + answers.get(109).getScoreCenter() + answers.get(109).getScoreA()
                + answers.get(135).getScoreCenter() + answers.get(135).getScoreA()
                + answers.get(146).getScoreCenter() + answers.get(146).getScoreB()
                + answers.get(149).getScoreCenter() + answers.get(149).getScoreA()
                + answers.get(152).getScoreCenter() + answers.get(152).getScoreA()

                + answers.get(153).getScoreCenter() + answers.get(153).getScoreB()
                + answers.get(154).getScoreCenter() + answers.get(154).getScoreA()
                + answers.get(155).getScoreCenter() + answers.get(155).getScoreA()
                + answers.get(157).getScoreCenter() + answers.get(157).getScoreA()
                + answers.get(160).getScoreCenter() + answers.get(160).getScoreA()

                + answers.get(162).getScoreCenter() + answers.get(162).getScoreA()
                + answers.get(163).getScoreCenter() + answers.get(163).getScoreA()
                + answers.get(164).getScoreCenter() + answers.get(164).getScoreB()) / 18.0;
        b = new BigDecimal(Ideation);
        Ideation = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

        //包容 Inclusiveness
        Double Inclusiveness = (answers.get(7).getScoreCenter() + answers.get(7).getScoreB()
                + answers.get(10).getScoreCenter() + answers.get(10).getScoreA()
                + answers.get(32).getScoreCenter() + answers.get(32).getScoreA()
                + answers.get(61).getScoreCenter() + answers.get(61).getScoreA()
                + answers.get(68).getScoreCenter() + answers.get(68).getScoreB()

                + answers.get(76).getScoreCenter() + answers.get(76).getScoreB()
                + answers.get(87).getScoreCenter() + answers.get(87).getScoreB()
                + answers.get(114).getScoreCenter() + answers.get(114).getScoreA()
                + answers.get(115).getScoreCenter() + answers.get(115).getScoreA()
                + answers.get(122).getScoreCenter() + answers.get(122).getScoreA()

                + answers.get(136).getScoreCenter() + answers.get(136).getScoreA()
                + answers.get(138).getScoreCenter() + answers.get(138).getScoreB()
                + answers.get(144).getScoreCenter() + answers.get(144).getScoreA()
                + answers.get(151).getScoreCenter() + answers.get(151).getScoreA()
                + answers.get(158).getScoreCenter() + answers.get(158).getScoreB()

                + answers.get(163).getScoreCenter() + answers.get(163).getScoreB()
                + answers.get(168).getScoreCenter() + answers.get(168).getScoreB()) / 17.0;
        b = new BigDecimal(Inclusiveness);
        Inclusiveness = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

        //个别 Individualization
        Double Individualization = (answers.get(7).getScoreCenter() + answers.get(7).getScoreA()
                + answers.get(29).getScoreCenter() + answers.get(29).getScoreA()
                + answers.get(40).getScoreCenter() + answers.get(40).getScoreA()
                + answers.get(57).getScoreCenter() + answers.get(57).getScoreA()
                + answers.get(62).getScoreCenter() + answers.get(62).getScoreB()

                + answers.get(66).getScoreCenter() + answers.get(66).getScoreA()
                + answers.get(68).getScoreCenter() + answers.get(68).getScoreA()
                + answers.get(69).getScoreCenter() + answers.get(69).getScoreA()
                + answers.get(91).getScoreCenter() + answers.get(91).getScoreA()
                + answers.get(136).getScoreCenter() + answers.get(136).getScoreB()

                + answers.get(140).getScoreCenter() + answers.get(140).getScoreA()
                + answers.get(144).getScoreCenter() + answers.get(144).getScoreB()
                + answers.get(151).getScoreCenter() + answers.get(151).getScoreA()
                + answers.get(163).getScoreCenter() + answers.get(163).getScoreB()
                + answers.get(166).getScoreCenter() + answers.get(166).getScoreA()
                + answers.get(179).getScoreCenter() + answers.get(179).getScoreB()) / 16.0;
        b = new BigDecimal(Individualization);
        Individualization = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

        //搜集 Input
        Double Input = (answers.get(41).getScoreCenter() + answers.get(41).getScoreB()
                + answers.get(48).getScoreCenter() + answers.get(48).getScoreB()
                + answers.get(61).getScoreCenter() + answers.get(61).getScoreA()
                + answers.get(63).getScoreCenter() + answers.get(63).getScoreA()
                + answers.get(69).getScoreCenter() + answers.get(69).getScoreA()

                + answers.get(84).getScoreCenter() + answers.get(84).getScoreA()
                + answers.get(85).getScoreCenter() + answers.get(85).getScoreA()
                + answers.get(89).getScoreCenter() + answers.get(89).getScoreB()
                + answers.get(107).getScoreCenter() + answers.get(107).getScoreA()
                + answers.get(119).getScoreCenter() + answers.get(119).getScoreA()

                + answers.get(134).getScoreCenter() + answers.get(134).getScoreA()
                + answers.get(144).getScoreCenter() + answers.get(144).getScoreB()
                + answers.get(145).getScoreCenter() + answers.get(145).getScoreA()
                + answers.get(151).getScoreCenter() + answers.get(151).getScoreA()
                + answers.get(172).getScoreCenter() + answers.get(172).getScoreB()

                + answers.get(176).getScoreCenter() + answers.get(176).getScoreA()
                + answers.get(178).getScoreCenter() + answers.get(178).getScoreB()) / 17.0;
        b = new BigDecimal(Input);
        Input = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

        //思维 Intellection
        Double Intellection = (answers.get(10).getScoreCenter() + answers.get(10).getScoreB()
                + answers.get(25).getScoreCenter() + answers.get(25).getScoreB()
                + answers.get(44).getScoreCenter() + answers.get(44).getScoreB()
                + answers.get(46).getScoreCenter() + answers.get(46).getScoreB()
                + answers.get(48).getScoreCenter() + answers.get(48).getScoreB()

                + answers.get(54).getScoreCenter() + answers.get(54).getScoreA()
                + answers.get(63).getScoreCenter() + answers.get(63).getScoreB()
                + answers.get(75).getScoreCenter() + answers.get(75).getScoreB()
                + answers.get(77).getScoreCenter() + answers.get(77).getScoreB()
                + answers.get(82).getScoreCenter() + answers.get(82).getScoreB()

                + answers.get(110).getScoreCenter() + answers.get(110).getScoreA()
                + answers.get(139).getScoreCenter() + answers.get(139).getScoreB()
                + answers.get(145).getScoreCenter() + answers.get(145).getScoreB()
                + answers.get(151).getScoreCenter() + answers.get(151).getScoreB()
                + answers.get(154).getScoreCenter() + answers.get(154).getScoreA()

                + answers.get(157).getScoreCenter() + answers.get(157).getScoreA()
                + answers.get(160).getScoreCenter() + answers.get(160).getScoreA()
                + answers.get(163).getScoreCenter() + answers.get(163).getScoreA()
                + answers.get(164).getScoreCenter() + answers.get(164).getScoreA()
                + answers.get(168).getScoreCenter() + answers.get(168).getScoreA()) / 20.0;
        b = new BigDecimal(Intellection);
        Intellection = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

        //学习 Leaner
        Double Leaner = (answers.get(0).getScoreCenter() + answers.get(0).getScoreB()
                + answers.get(3).getScoreCenter() + answers.get(3).getScoreB()
                + answers.get(48).getScoreCenter() + answers.get(48).getScoreB()
                + answers.get(65).getScoreCenter() + answers.get(65).getScoreB()
                + answers.get(75).getScoreCenter() + answers.get(75).getScoreB()
                + answers.get(85).getScoreCenter() + answers.get(85).getScoreA()

                + answers.get(89).getScoreCenter() + answers.get(89).getScoreA()
                + answers.get(105).getScoreCenter() + answers.get(105).getScoreA()
                + answers.get(127).getScoreCenter() + answers.get(127).getScoreA()
                + answers.get(130).getScoreCenter() + answers.get(130).getScoreA()
                + answers.get(131).getScoreCenter() + answers.get(131).getScoreA()

                + answers.get(139).getScoreCenter() + answers.get(139).getScoreB()
                + answers.get(148).getScoreCenter() + answers.get(148).getScoreB()
                + answers.get(154).getScoreCenter() + answers.get(154).getScoreA()
                + answers.get(160).getScoreCenter() + answers.get(160).getScoreA()
                + answers.get(165).getScoreCenter() + answers.get(165).getScoreB()) / 16.0;
        b = new BigDecimal(Leaner);
        Leaner = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

        //完美 Maximizer
        Double Maximizer = (answers.get(3).getScoreCenter() + answers.get(3).getScoreA()
                + answers.get(5).getScoreCenter() + answers.get(5).getScoreA()
                + answers.get(12).getScoreCenter() + answers.get(12).getScoreB()
                + answers.get(16).getScoreCenter() + answers.get(16).getScoreB()
                + answers.get(54).getScoreCenter() + answers.get(54).getScoreA()

                + answers.get(55).getScoreCenter() + answers.get(55).getScoreB()
                + answers.get(65).getScoreCenter() + answers.get(65).getScoreA()
                + answers.get(83).getScoreCenter() + answers.get(83).getScoreA()
                + answers.get(85).getScoreCenter() + answers.get(85).getScoreB()
                + answers.get(92).getScoreCenter() + answers.get(92).getScoreB()

                + answers.get(134).getScoreCenter() + answers.get(134).getScoreB()
                + answers.get(136).getScoreCenter() + answers.get(136).getScoreB()
                + answers.get(139).getScoreCenter() + answers.get(139).getScoreB()
                + answers.get(140).getScoreCenter() + answers.get(140).getScoreA()
                + answers.get(145).getScoreCenter() + answers.get(145).getScoreB()

                + answers.get(148).getScoreCenter() + answers.get(148).getScoreA()
                + answers.get(169).getScoreCenter() + answers.get(169).getScoreA()) / 17.0;
        b = new BigDecimal(Maximizer);
        Maximizer = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

        //积极 Positivity
        Double Positivity = (answers.get(9).getScoreCenter() + answers.get(9).getScoreA()
                + answers.get(18).getScoreCenter() + answers.get(18).getScoreA()
                + answers.get(23).getScoreCenter() + answers.get(23).getScoreA()
                + answers.get(26).getScoreCenter() + answers.get(26).getScoreA()
                + answers.get(30).getScoreCenter() + answers.get(30).getScoreB()

                + answers.get(31).getScoreCenter() + answers.get(31).getScoreA()
                + answers.get(40).getScoreCenter() + answers.get(40).getScoreB()
                + answers.get(54).getScoreCenter() + answers.get(54).getScoreB()
                + answers.get(59).getScoreCenter() + answers.get(59).getScoreA()
                + answers.get(60).getScoreCenter() + answers.get(60).getScoreA()

                + answers.get(64).getScoreCenter() + answers.get(64).getScoreA()
                + answers.get(65).getScoreCenter() + answers.get(65).getScoreB()
                + answers.get(78).getScoreCenter() + answers.get(78).getScoreB()
                + answers.get(98).getScoreCenter() + answers.get(98).getScoreB()
                + answers.get(108).getScoreCenter() + answers.get(108).getScoreB()
                + answers.get(120).getScoreCenter() + answers.get(120).getScoreB()) / 16.0;
        b = new BigDecimal(Positivity);
        Positivity = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

        //交往 relator
        Double relator = (answers.get(0).getScoreCenter() + answers.get(0).getScoreA()
                + answers.get(10).getScoreCenter() + answers.get(10).getScoreA()
                + answers.get(13).getScoreCenter() + answers.get(13).getScoreA()
                + answers.get(24).getScoreCenter() + answers.get(24).getScoreB()
                + answers.get(48).getScoreCenter() + answers.get(48).getScoreA()
                + answers.get(66).getScoreCenter() + answers.get(66).getScoreA()
                + answers.get(76).getScoreCenter() + answers.get(76).getScoreB()
                + answers.get(87).getScoreCenter() + answers.get(87).getScoreA()
                + answers.get(88).getScoreCenter() + answers.get(88).getScoreB()
                + answers.get(101).getScoreCenter() + answers.get(101).getScoreB()
                + answers.get(102).getScoreCenter() + answers.get(102).getScoreA()
                + answers.get(110).getScoreCenter() + answers.get(110).getScoreB()
                + answers.get(113).getScoreCenter() + answers.get(113).getScoreA()
                + answers.get(123).getScoreCenter() + answers.get(123).getScoreA()
                + answers.get(138).getScoreCenter() + answers.get(138).getScoreB()
                + answers.get(177).getScoreCenter() + answers.get(177).getScoreA()) / 16.0;
        b = new BigDecimal(relator);
        relator = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

        //责任 Responsibility
        Double Responsibility = (answers.get(4).getScoreCenter() + answers.get(4).getScoreB()
                + answers.get(36).getScoreCenter() + answers.get(36).getScoreB()
                + answers.get(92).getScoreCenter() + answers.get(92).getScoreA()
                + answers.get(93).getScoreCenter() + answers.get(93).getScoreA()
                + answers.get(103).getScoreCenter() + answers.get(103).getScoreA()

                + answers.get(115).getScoreCenter() + answers.get(115).getScoreB()
                + answers.get(118).getScoreCenter() + answers.get(118).getScoreB()
                + answers.get(121).getScoreCenter() + answers.get(121).getScoreB()
                + answers.get(125).getScoreCenter() + answers.get(125).getScoreA()
                + answers.get(126).getScoreCenter() + answers.get(126).getScoreB()

                + answers.get(128).getScoreCenter() + answers.get(128).getScoreB()
                + answers.get(142).getScoreCenter() + answers.get(142).getScoreB()
                + answers.get(143).getScoreCenter() + answers.get(143).getScoreB()
                + answers.get(159).getScoreCenter() + answers.get(159).getScoreA()
                + answers.get(161).getScoreCenter() + answers.get(161).getScoreB()
                + answers.get(162).getScoreCenter() + answers.get(162).getScoreA()) / 16.0;
        b = new BigDecimal(Responsibility);
        Responsibility = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

        //排难 Restorative
        Double Restorative = (answers.get(0).getScoreCenter() + answers.get(0).getScoreA()
                + answers.get(32).getScoreCenter() + answers.get(32).getScoreB()
                + answers.get(43).getScoreCenter() + answers.get(43).getScoreB()
                + answers.get(79).getScoreCenter() + answers.get(79).getScoreB()
                + answers.get(81).getScoreCenter() + answers.get(81).getScoreB()
                + answers.get(117).getScoreCenter() + answers.get(117).getScoreB()
                + answers.get(125).getScoreCenter() + answers.get(125).getScoreA()
                + answers.get(135).getScoreCenter() + answers.get(135).getScoreB()
                + answers.get(137).getScoreCenter() + answers.get(137).getScoreB()
                + answers.get(138).getScoreCenter() + answers.get(138).getScoreA()
                + answers.get(139).getScoreCenter() + answers.get(139).getScoreA()
                + answers.get(147).getScoreCenter() + answers.get(147).getScoreA()
                + answers.get(152).getScoreCenter() + answers.get(152).getScoreB()
                + answers.get(159).getScoreCenter() + answers.get(159).getScoreA()
                + answers.get(173).getScoreCenter() + answers.get(173).getScoreB()
                + answers.get(179).getScoreCenter() + answers.get(179).getScoreA()) / 16.0;
        b = new BigDecimal(Restorative);
        Restorative = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
        System.out.print("排难  Restorative：" + Restorative);
        //自信 SelfAssurance
        Double SelfAssurance = (answers.get(9).getScoreCenter() + answers.get(9).getScoreB()
                + answers.get(10).getScoreCenter() + answers.get(10).getScoreB()
                + answers.get(41).getScoreCenter() + answers.get(41).getScoreA()
                + answers.get(45).getScoreCenter() + answers.get(45).getScoreA()
                + answers.get(47).getScoreCenter() + answers.get(47).getScoreB()
                + answers.get(67).getScoreCenter() + answers.get(67).getScoreB()
                + answers.get(70).getScoreCenter() + answers.get(70).getScoreA()
                + answers.get(97).getScoreCenter() + answers.get(97).getScoreB()
                + answers.get(100).getScoreCenter() + answers.get(100).getScoreA()
                + answers.get(112).getScoreCenter() + answers.get(112).getScoreB()
                + answers.get(119).getScoreCenter() + answers.get(119).getScoreB()
                + answers.get(123).getScoreCenter() + answers.get(123).getScoreB()
                + answers.get(146).getScoreCenter() + answers.get(146).getScoreB()
                + answers.get(148).getScoreCenter() + answers.get(148).getScoreA()
                + answers.get(167).getScoreCenter() + answers.get(167).getScoreB()
                + answers.get(170).getScoreCenter() + answers.get(170).getScoreA()
                + answers.get(179).getScoreCenter() + answers.get(179).getScoreA()) / 17.0;
        b = new BigDecimal(SelfAssurance);
        SelfAssurance = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

        //追求 Significance
        Double Significance = (answers.get(2).getScoreCenter() + answers.get(2).getScoreB()
                + answers.get(5).getScoreCenter() + answers.get(5).getScoreB()
                + answers.get(16).getScoreCenter() + answers.get(16).getScoreB()
                + answers.get(17).getScoreCenter() + answers.get(17).getScoreB()
                + answers.get(23).getScoreCenter() + answers.get(23).getScoreB()

                + answers.get(27).getScoreCenter() + answers.get(27).getScoreA()
                + answers.get(35).getScoreCenter() + answers.get(35).getScoreA()
                + answers.get(36).getScoreCenter() + answers.get(36).getScoreA()
                + answers.get(52).getScoreCenter() + answers.get(52).getScoreB()
                + answers.get(65).getScoreCenter() + answers.get(65).getScoreA()

                + answers.get(85).getScoreCenter() + answers.get(85).getScoreA()
                + answers.get(92).getScoreCenter() + answers.get(92).getScoreA()
                + answers.get(100).getScoreCenter() + answers.get(100).getScoreA()
                + answers.get(116).getScoreCenter() + answers.get(116).getScoreA()
                + answers.get(120).getScoreCenter() + answers.get(120).getScoreA()

                + answers.get(127).getScoreCenter() + answers.get(127).getScoreB()
                + answers.get(130).getScoreCenter() + answers.get(130).getScoreB()
                + answers.get(131).getScoreCenter() + answers.get(131).getScoreB()
                + answers.get(151).getScoreCenter() + answers.get(151).getScoreB()) / 19.0;
        b = new BigDecimal(Significance);
        Significance = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
        System.out.print("追求 Significance：" + Significance);
        //战略 Strategic
        Double Strategic = (answers.get(6).getScoreCenter() + answers.get(6).getScoreB()
                + answers.get(17).getScoreCenter() + answers.get(17).getScoreB()
                + answers.get(25).getScoreCenter() + answers.get(25).getScoreB()
                + answers.get(31).getScoreCenter() + answers.get(31).getScoreB()
                + answers.get(43).getScoreCenter() + answers.get(43).getScoreB()
                + answers.get(50).getScoreCenter() + answers.get(50).getScoreB()
                + answers.get(61).getScoreCenter() + answers.get(61).getScoreB()
                + answers.get(70).getScoreCenter() + answers.get(70).getScoreB()
                + answers.get(73).getScoreCenter() + answers.get(73).getScoreB()
                + answers.get(84).getScoreCenter() + answers.get(84).getScoreB()
                + answers.get(95).getScoreCenter() + answers.get(95).getScoreA()
                + answers.get(99).getScoreCenter() + answers.get(99).getScoreB()
                + answers.get(132).getScoreCenter() + answers.get(132).getScoreA()
                + answers.get(137).getScoreCenter() + answers.get(137).getScoreB()
                + answers.get(142).getScoreCenter() + answers.get(142).getScoreB()
                + answers.get(149).getScoreCenter() + answers.get(149).getScoreA()
                + answers.get(152).getScoreCenter() + answers.get(152).getScoreA()
                + answers.get(153).getScoreCenter() + answers.get(153).getScoreB()
                + answers.get(167).getScoreCenter() + answers.get(167).getScoreB()
                + answers.get(178).getScoreCenter() + answers.get(178).getScoreA()) / 20.0;
        b = new BigDecimal(Strategic);
        Strategic = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

        //取悦 Woo
        Double Woo = (answers.get(2).getScoreCenter() + answers.get(2).getScoreA()
                + answers.get(6).getScoreCenter() + answers.get(6).getScoreA()
                + answers.get(8).getScoreCenter() + answers.get(8).getScoreB()
                + answers.get(23).getScoreCenter() + answers.get(23).getScoreA()
                + answers.get(32).getScoreCenter() + answers.get(32).getScoreB()
                + answers.get(38).getScoreCenter() + answers.get(38).getScoreB()
                + answers.get(68).getScoreCenter() + answers.get(68).getScoreB()
                + answers.get(72).getScoreCenter() + answers.get(72).getScoreB()
                + answers.get(87).getScoreCenter() + answers.get(87).getScoreA()
                + answers.get(88).getScoreCenter() + answers.get(88).getScoreB()
                + answers.get(94).getScoreCenter() + answers.get(94).getScoreA()
                + answers.get(104).getScoreCenter() + answers.get(104).getScoreA()
                + answers.get(106).getScoreCenter() + answers.get(106).getScoreB()
                + answers.get(136).getScoreCenter() + answers.get(136).getScoreA()
                + answers.get(144).getScoreCenter() + answers.get(144).getScoreA()
                + answers.get(177).getScoreCenter() + answers.get(177).getScoreB()) / 16.0;
        b = new BigDecimal(Woo);
        Woo = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

        HashMap<String, Double> map = new HashMap<>();
        map.put("成就", Achiever);
        map.put("行动", Activator);
        map.put("适应", Adaptability);
        map.put("分析", Analytical);
        map.put("统筹", Arranger);
        map.put("信仰", Belief);
        map.put("统率", Command);
        map.put("沟通", Communication);
        map.put("竞争", Competition);
        map.put("关联", Connectedness);
        map.put("回顾", Context);
        map.put("审慎", Deliberative);
        map.put("伯乐", Developer);
        map.put("纪律", Discipline);
        map.put("体谅", Empathy);
        map.put("公平", fairness);
        map.put("专注", Focus);
        map.put("前瞻", Futuristic);
        map.put("和谐", Harmony);
        map.put("理念", Ideation);
        map.put("包容", Inclusiveness);
        map.put("个别", Individualization);
        map.put("搜集", Input);
        map.put("思维", Intellection);
        map.put("学习", Leaner);
        map.put("完美", Maximizer);
        map.put("积极", Positivity);
        map.put("交往", relator);
        map.put("责任", Responsibility);
        map.put("排难", Restorative);
        map.put("自信", SelfAssurance);
        map.put("追求", Significance);
        map.put("战略", Strategic);
        map.put("取悦", Woo);

        List<Map.Entry<String, Double>> list = new ArrayList<>(map.entrySet());
        Collections.sort(list, new Comparator<Map.Entry<String, Double>>() {
            @Override
            public int compare(Map.Entry<String, Double> o1, Map.Entry<String, Double> o2) {
                return o1.getValue().compareTo(o2.getValue());
            }
        });
        Collections.reverse(list);

        //把得出的结果放到一个
        LinkedHashMap<String, String> treeMap = new LinkedHashMap<>();
        for (Map.Entry<String, Double> mapping : list) {
            treeMap.put(mapping.getKey(), String.format("%.2f", new BigDecimal(mapping.getValue()).setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue()));
        }
        System.out.println("resultmap:" + treeMap);
        return JSON.toJSONString(treeMap);
    }

    /**
     * 用答案的List集合获得结果的String(93)
     *
     * @param ExistAnswerList
     * @return
     * @throws Exception
     */
    public String getResultByAnswerList93(ArrayList<String> ExistAnswerList) throws Exception {
        //是93题
        //遍历判断180个值是否全相同
        //定义一个标记
        boolean flag = true;//默认是相同的
        for (int i = 1; i < ExistAnswerList.size(); i++) {
            if (!ExistAnswerList.get(i - 1).equals(ExistAnswerList.get(i))) {
                flag = false;
            }
            if (flag == false) {
                break;
            }
        }
        if (flag == true) {
            //所有的都是相同的
            throw new Exception("您好，系统检测到您提交的测试结果异常，请重新答题。");

        }

        //把对象放入集合
        ArrayList<Answer> answers = new ArrayList<>();
        for (String answerString : ExistAnswerList) {
            Answer answerPojo = new Answer();
            if (answerString.equals("A")) {
                answerPojo.setScoreA(1);
            } else if (answerString.equals("B")) {
                answerPojo.setScoreB(1);
            }
            answers.add(answerPojo);
        }

        Integer E = answers.get(3).getScoreA() + answers.get(7).getScoreA()
                + answers.get(11).getScoreB() + answers.get(13).getScoreA()
                + answers.get(17).getScoreB() + answers.get(18).getScoreA()
                + answers.get(21).getScoreB() + answers.get(22).getScoreA()
                + answers.get(25).getScoreB() + answers.get(26).getScoreB()

                + answers.get(33).getScoreA() + answers.get(34).getScoreB()
                + answers.get(41).getScoreB() + answers.get(47).getScoreB()
                + answers.get(53).getScoreB() + answers.get(59).getScoreB()
                + answers.get(61).getScoreA() + answers.get(65).getScoreB()
                + answers.get(66).getScoreA() + answers.get(71).getScoreB()
                + answers.get(76).getScoreA();

        Integer I = answers.get(3).getScoreB() + answers.get(7).getScoreB()
                + answers.get(11).getScoreA() + answers.get(13).getScoreB()
                + answers.get(17).getScoreA() + answers.get(18).getScoreB()
                + answers.get(21).getScoreA() + answers.get(22).getScoreB()
                + answers.get(25).getScoreA() + answers.get(26).getScoreA()

                + answers.get(33).getScoreB() + answers.get(34).getScoreA()
                + answers.get(41).getScoreA() + answers.get(47).getScoreA()
                + answers.get(53).getScoreA() + answers.get(59).getScoreA()
                + answers.get(61).getScoreB() + answers.get(65).getScoreA()
                + answers.get(66).getScoreB() + answers.get(71).getScoreA()
                + answers.get(76).getScoreB();

        Integer S = answers.get(2).getScoreA() + answers.get(4).getScoreB()
                + answers.get(12).getScoreA() + answers.get(14).getScoreB()
                + answers.get(23).getScoreB() + answers.get(28).getScoreB()
                + answers.get(31).getScoreA() + answers.get(36).getScoreB()
                + answers.get(39).getScoreA() + answers.get(43).getScoreB()
                + answers.get(46).getScoreA() + answers.get(49).getScoreB()
                + answers.get(52).getScoreA() + answers.get(54).getScoreB()
                + answers.get(57).getScoreA() + answers.get(60).getScoreA()
                + answers.get(62).getScoreB() + answers.get(72).getScoreA()
                + answers.get(73).getScoreB() + answers.get(78).getScoreB()
                + answers.get(81).getScoreA() + answers.get(82).getScoreB()
                + answers.get(85).getScoreA() + answers.get(86).getScoreB()
                + answers.get(89).getScoreA() + answers.get(92).getScoreA();

        Integer N = answers.get(2).getScoreB() + answers.get(4).getScoreA()
                + answers.get(12).getScoreB() + answers.get(14).getScoreA()
                + answers.get(23).getScoreA() + answers.get(28).getScoreA()
                + answers.get(31).getScoreB() + answers.get(36).getScoreA()
                + answers.get(39).getScoreB() + answers.get(43).getScoreA()

                + answers.get(46).getScoreB() + answers.get(49).getScoreA()
                + answers.get(52).getScoreB() + answers.get(54).getScoreA()
                + answers.get(57).getScoreB() + answers.get(60).getScoreB()
                + answers.get(62).getScoreA() + answers.get(72).getScoreB()
                + answers.get(73).getScoreA() + answers.get(74).getScoreB()

                + answers.get(78).getScoreA() + answers.get(81).getScoreB()
                + answers.get(82).getScoreA() + answers.get(85).getScoreB()
                + answers.get(86).getScoreA() + answers.get(89).getScoreB()
                + answers.get(92).getScoreB();

        Integer T = answers.get(5).getScoreB() + answers.get(15).getScoreB()
                + answers.get(29).getScoreB() + answers.get(30).getScoreA()
                + answers.get(37).getScoreB() + answers.get(38).getScoreA()
                + answers.get(44).getScoreB() + answers.get(45).getScoreA()
                + answers.get(50).getScoreB() + answers.get(51).getScoreA()

                + answers.get(55).getScoreB() + answers.get(56).getScoreA()
                + answers.get(63).getScoreB() + answers.get(68).getScoreA()
                + answers.get(74).getScoreA() + answers.get(77).getScoreA()
                + answers.get(79).getScoreB() + answers.get(80).getScoreA()
                + answers.get(83).getScoreB() + answers.get(84).getScoreA()

                + answers.get(87).getScoreB() + answers.get(88).getScoreA()
                + answers.get(90).getScoreB() + answers.get(91).getScoreA();

        Integer F = answers.get(5).getScoreA() + answers.get(15).getScoreA()
                + answers.get(29).getScoreA() + answers.get(30).getScoreB()
                + answers.get(37).getScoreA() + answers.get(38).getScoreB()
                + answers.get(44).getScoreA() + answers.get(45).getScoreB()
                + answers.get(50).getScoreA() + answers.get(51).getScoreB()

                + answers.get(55).getScoreA() + answers.get(56).getScoreB()
                + answers.get(63).getScoreA() + answers.get(68).getScoreB()
                + answers.get(77).getScoreB() + answers.get(79).getScoreA()
                + answers.get(80).getScoreB() + answers.get(83).getScoreA()
                + answers.get(84).getScoreB() + answers.get(87).getScoreA()

                + answers.get(88).getScoreB() + answers.get(90).getScoreA()
                + answers.get(91).getScoreB();

        Integer J = answers.get(0).getScoreA() + answers.get(1).getScoreB()
                + answers.get(6).getScoreB() + answers.get(8).getScoreA()
                + answers.get(9).getScoreA() + answers.get(10).getScoreB()
                + answers.get(16).getScoreB() + answers.get(19).getScoreA()
                + answers.get(20).getScoreB() + answers.get(24).getScoreB()

                + answers.get(27).getScoreA() + answers.get(32).getScoreB()
                + answers.get(35).getScoreA() + answers.get(40).getScoreB()
                + answers.get(42).getScoreA() + answers.get(48).getScoreA()
                + answers.get(58).getScoreA() + answers.get(64).getScoreB()
                + answers.get(67).getScoreA() + answers.get(69).getScoreA()

                + answers.get(70).getScoreB() + answers.get(75).getScoreB();

        Integer P = answers.get(0).getScoreB() + answers.get(1).getScoreA()
                + answers.get(6).getScoreA() + answers.get(8).getScoreB()
                + answers.get(9).getScoreB() + answers.get(10).getScoreA()
                + answers.get(16).getScoreA() + answers.get(19).getScoreB()
                + answers.get(20).getScoreA() + answers.get(24).getScoreA()
                + answers.get(27).getScoreB() + answers.get(32).getScoreA()
                + answers.get(35).getScoreB() + answers.get(40).getScoreA()
                + answers.get(42).getScoreB() + answers.get(48).getScoreB()
                + answers.get(58).getScoreB() + answers.get(64).getScoreA()
                + answers.get(67).getScoreB() + answers.get(69).getScoreB()
                + answers.get(70).getScoreA() + answers.get(75).getScoreA();

        LinkedHashMap<String, Integer> result = new LinkedHashMap<>();
        result.put("I-内向", I);
        result.put("E-外向", E);
        result.put("N-直觉", N);
        result.put("S-实感", S);
        result.put("F-情感", F);
        result.put("T-思考", T);
        result.put("J-判断", J);
        result.put("P-认知", P);

        List<Map.Entry<String, Integer>> list = new ArrayList(result.entrySet());
        Collections.sort(list, new Comparator<Map.Entry<String, Integer>>() {
            @Override
            public int compare(Map.Entry<String, Integer> o1, Map.Entry<String, Integer> o2) {
                return o1.getValue().compareTo(o2.getValue());
            }
        });
        Collections.reverse(list);

        return JSON.toJSONString(list);
    }

    /**
     * 用答案的List集合获得结果的String(7)
     *
     * @param ExistAnswerList
     * @return
     * @throws Exception
     */
    public String getResultByAnswerList7(ArrayList<String> ExistAnswerList) throws Exception {
        //是7题
        //遍历判断7个值是否全相同
        //定义一个标记
        boolean flag = true;//默认是相同的
        for (int i = 1; i < ExistAnswerList.size(); i++) {
            if (!ExistAnswerList.get(i - 1).equals(ExistAnswerList.get(i))) {
                flag = false;
            }
            if (flag == false) {
                break;
            }
        }
        if (flag == true) {
            //所有的都是相同的
            throw new Exception("您好，系统检测到您提交的测试结果异常，请重新答题。");

        }

        //把对象放入集合
        ArrayList<Answer7> answers = new ArrayList<>();
        for (String answerString : ExistAnswerList) {
            ArrayList<Integer> answer = JSON.parseObject(answerString, ArrayList.class);
            Answer7 answerPojo = new Answer7();
            answerPojo.setScoreA(answer.get(0));
            answerPojo.setScoreB(answer.get(1));
            answerPojo.setScoreC(answer.get(2));
            answerPojo.setScoreD(answer.get(3));
            answerPojo.setScoreE(answer.get(4));
            answerPojo.setScoreF(answer.get(5));
            answerPojo.setScoreG(answer.get(6));
            answerPojo.setScoreH(answer.get(7));
            answers.add(answerPojo);
        }

        Integer CW = answers.get(0).getScoreG() + answers.get(1).getScoreA()
                + answers.get(2).getScoreH() + answers.get(3).getScoreD()
                + answers.get(4).getScoreB() + answers.get(5).getScoreF()
                + answers.get(6).getScoreE();

        Integer CO = answers.get(0).getScoreD() + answers.get(1).getScoreB()
                + answers.get(2).getScoreA() + answers.get(3).getScoreH()
                + answers.get(4).getScoreF() + answers.get(5).getScoreC()
                + answers.get(6).getScoreG();

        Integer SH = answers.get(0).getScoreF() + answers.get(1).getScoreE()
                + answers.get(2).getScoreC() + answers.get(3).getScoreB()
                + answers.get(4).getScoreD() + answers.get(5).getScoreG()
                + answers.get(6).getScoreA();

        Integer PL = answers.get(0).getScoreC() + answers.get(1).getScoreG()
                + answers.get(2).getScoreD() + answers.get(3).getScoreE()
                + answers.get(4).getScoreH() + answers.get(5).getScoreA()
                + answers.get(6).getScoreF();

        Integer RI = answers.get(0).getScoreA() + answers.get(1).getScoreC()
                + answers.get(2).getScoreF() + answers.get(3).getScoreG()
                + answers.get(4).getScoreE() + answers.get(5).getScoreH()
                + answers.get(6).getScoreD();

        Integer ME = answers.get(0).getScoreH() + answers.get(1).getScoreD()
                + answers.get(2).getScoreG() + answers.get(3).getScoreC()
                + answers.get(4).getScoreA() + answers.get(5).getScoreE()
                + answers.get(6).getScoreB();

        Integer TW = answers.get(0).getScoreB() + answers.get(1).getScoreF()
                + answers.get(2).getScoreE() + answers.get(3).getScoreA()
                + answers.get(4).getScoreC() + answers.get(5).getScoreB()
                + answers.get(6).getScoreH();

        Integer FI = answers.get(0).getScoreE() + answers.get(1).getScoreH()
                + answers.get(2).getScoreB() + answers.get(3).getScoreF()
                + answers.get(4).getScoreG() + answers.get(5).getScoreD()
                + answers.get(6).getScoreC();

        LinkedHashMap<String, Integer> result = new LinkedHashMap<>();

        result.put("CW", CW);
        result.put("CO", CO);
        result.put("SH", SH);
        result.put("PL", PL);
        result.put("RI", RI);
        result.put("ME", ME);
        result.put("TW", TW);
        result.put("FI", FI);

        List<Map.Entry<String, Integer>> list = new ArrayList(result.entrySet());
        Collections.sort(list, new Comparator<Map.Entry<String, Integer>>() {
            @Override
            public int compare(Map.Entry<String, Integer> o1, Map.Entry<String, Integer> o2) {
                return o1.getValue().compareTo(o2.getValue());
            }
        });
        Collections.reverse(list);
        return JSON.toJSONString(list);
    }

    /**
     * 用手机号和名字获取用户信息
     *
     * @param userName 用户名
     * @param phoneNum 电话号码
     * @return
     */
    public TestResult getUserInfoByUserNameAndPhoneNum(String userName, String phoneNum) {
        TestResult testResult = new TestResult();
        //用名字和手机号获取工号；
        String getWorkCode = HttpUtil.toInterface("http://192.168.0.86:8085/Hrm/getWorkCode/byUserNameAndPhoneNum?userName=" + userName + "&phoneNum=" + phoneNum);
        Object workCode = JSON.parseObject(getWorkCode).get("data");
        if (workCode != null) {
            testResult.setWorkCode(workCode.toString());//工号
            String userInfo = GetUserInfoUtil.getUserInfo(workCode.toString());
            //获取上级的名字
            Integer managerid = Integer.valueOf(XmlUtil.readStringXml(userInfo, "managerid"));
            if (managerid != null && managerid != 0) {
                String getLastName = HttpUtil.toInterface("http://192.168.0.86:8085/Hrm/getLastname/byId?managerid=" + managerid);
                String lastname = JSON.parseObject(getLastName).get("data").toString();
                System.out.println("lastname:" + lastname);
                testResult.setManagername(lastname);//上级名字
            }
        }
        testResult.setMobilePhone(phoneNum);//手机号
        testResult.setUserName(userName);//名字
        return testResult;
    }
}
